package com.wt.admin.domain.vo.socket;


import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.Builder;
import lombok.Data;
import lombok.SneakyThrows;


@Data
public class SocketVO<T> {

    @JsonIgnore
    private ObjectMapper mapper = new ObjectMapper();

    private T data;

    private String type;

    public SocketVO(String type,T data) {
        this.type = type;
        this.data = data;
    }

    public String getJson(){
        return JSONUtil.toJsonStr(this);
    }

}
